package com.yuwj.chinaa.util;

import android.app.Activity;
import android.content.Context;
import android.widget.Toast;


public class ToastUtil {

    private static ToastUtil instance;

    public synchronized static ToastUtil getInstance() {
        if (instance == null) {
            instance = new ToastUtil();
        }
        return instance;
    }


    public void shortLength(final Context context, final String msg) {
        if(context instanceof Activity){
            ((Activity)context).runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
                }
            });
        }
    }

    public void longLength(Context context, String msg) {
        Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
    }

}
